﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Web;
using Microsoft.SharePoint;
using WeMakeSP.Platform.Drawing;
using WeMakeSP.Platform.SharePoint.Configuration;
using WeMakeSP.Platform.SharePoint.Events;

namespace WeMakeSP.ImageResizer.Configuration
{
    /// <summary>
    /// Represents the configuration of Image Resizer
    /// in the context of a picture library.
    /// </summary>
    public class ImageResizerPictureLibraryConfiguration
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ImageResizerPictureLibraryConfiguration"/> class.
        /// </summary>
        public ImageResizerPictureLibraryConfiguration()
        {
            this.Action = ImageResizerAction.Resize;
            this.Active = false;
            this.Mode = ImageResizerMode.ResizeProportional;
            this.MaxWidth = 800;
            this.MaxHeight = 600;
            this.HoursDelay = 0;
            this.HourSchedule = 0;
            this.MinuteSchedule = 0;
            this.MinutesDelay = 2;
            this.Schedule = ImageResizerSchedule.Immediate;
            this.SecondsDelay = 0;
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the action.
        /// </summary>
        /// <value>The action.</value>
        public ImageResizerAction Action
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="ImageResizerPictureLibraryConfiguration"/> is active.
        /// </summary>
        /// <value><c>True</c> if active; otherwise, <c>false</c>.</value>
        public bool Active
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the hours delay.
        /// </summary>
        /// <value>The hours delay.</value>
        public int HoursDelay
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the hour schedule.
        /// </summary>
        /// <value>The hour schedule.</value>
        public int HourSchedule
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the width of the max.
        /// </summary>
        /// <value>The width of the max.</value>
        public int MaxWidth
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the height of the max.
        /// </summary>
        /// <value>The height of the max.</value>
        public int MaxHeight
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the minutes delay.
        /// </summary>
        /// <value>The minutes delay.</value>
        public int MinutesDelay
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the minute schedule.
        /// </summary>
        /// <value>The minute schedule.</value>
        public int MinuteSchedule
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the mode.
        /// </summary>
        /// <value>The image resize mode.</value>
        public ImageResizerMode Mode
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the schedule.
        /// </summary>
        /// <value>The schedule.</value>
        public ImageResizerSchedule Schedule
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the seconds delay.
        /// </summary>
        /// <value>The seconds delay.</value>
        public int SecondsDelay
        {
            get;
            set;
        }

        #endregion
    }
}